<?php 
include("header.php");
$words='您的每一条建议，我们都会虚心听取，用心改进，以求为您呈现更精彩的投资文章，更愉快的访问体验。';
?>

<div class="container">
	<div class="main">
		<div id="advice-edit" class="article_body" style="width:80%;margin-top:14px;height:400px;">
      <h2 style="font-size:32px;font-weight:normal;margin:2px 0;">发表您对<a href="http://www.jztzp.com/">价值投资派</a>的宝贵建议</h2>
      <p style="font-size:16px;"><?php echo $words ?></p>
      <textarea id="advice-content" style="width:96%;margin:2px auto;height:236px;border: 1px solid #AEBACD; overflow: auto;font-size: 14px; line-height: 20px; margin-bottom: 10px; padding: 4px; resize: none; "></textarea>
      <input id="advice-submit" style="float:right;margin-right:4px;" type="button" value="发表建议"/>
		</div>
		<div id="advice-submitted" class="article_body" style="width:80%;margin-top:16px;height:160px;display:none;">
      <h2 style="font-size:32px;font-weight:normal;margin:2px 0;">提交成功，非常感谢您的宝贵建议!</h2>
      <p style="font-size:16px;"><?php echo $words ?></p>
      <p style="font-size:20px;"><a href="http://www.jztzp.com/">返回首页</a></p>
		</div>
	</div>
</div>

  <div class="footer">
    <span style="font-weight:bold;">www.<span style="color:#22a;">J</span><span style="color:orange;">Z</span><span style="color:#eb0;">T</span><span style="color:green;">Z</span><span style="color:#a22;">P</span>.com </span> &copy; <span style="font-size:88%;">豫ICP备10022612号</span>
  </div>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript">
function AdviceSubmit() {
  var txt = $('#advice-content').val();
  var mail = $('#mail').val();
  if (txt.length <= 0) {
    alert('无法提交空内容');
    return;
  }
  $.ajax('/advice-submit.php', {
    'data' : 'txt=' + encodeURIComponent(txt),
    'type' : 'POST',
    'success' : function(text){
       $('div#advice-edit').hide();
       $('div#advice-submitted').show();
    },
    'error' : function(){
      alert('抱歉！提交失败');
    }
  });
  // window.location = 'http://www.jztzp.com/search?q=' + encodeURIComponent(txt) + '&s=1&c=10';
}

$('#advice-submit').click(AdviceSubmit);

$('#advice-content').keyup(
  function(event) {
    if(event.keyCode == 13) {
      // GoSearch($(this));
    }
  }
);
</script>
</body>
</html>
